package com.snail.controller.aichat;

import java.util.List;

/**
 * @author ysc
 * @descrpiton ai生成的问题的请求格式规范，使用openai的标准
 * @params model 为传入的模型
 * @params List<Message> 为传入的消息列表
 * @date 2025/7/15 11:44
 **/
public class ChatRequest {
    private String model;

    private List<Message> messages;
    private ResponseFormat response_format;


    public ChatRequest(String model, List<Message> messages) {
        this.model = model;
        this.messages = messages;
        this.response_format = new ResponseFormat("json_object");

    }

    public void setModel(String model) {
        this.model = model;
    }

    public void setMessages(List<Message> messages) {
        this.messages = messages;
    }

    public ResponseFormat getResponse_format() {
        return response_format;
    }

    public void setResponse_format(ResponseFormat response_format) {
        this.response_format = response_format;
    }

    public static class ResponseFormat {
        private String type;

        public ResponseFormat(String type) {
            this.type = type;
        }

        public String getType() {
            return type;
        }
    }
    public String getModel() {
        return model;
    }

    public List<Message> getMessages() {
        return messages;
    }



    public static class Message {
        private String role;
        private String content;

        public Message(String role, String content) {
            this.role = role;
            this.content = content;
        }

        public String getRole() {
            return role;
        }

        public String getContent() {
            return content;
        }
    }
}
